<html>
<head>
	<meta charset="UTF-8">
	<title>axios-axios.all</title>
	<script type="text/javascript" src="./axios.js"></script>
</head>
<body>

<script type="text/javascript">

function test01() {
    return axios.get('/user/queryUserList.do');
}
function test02() {
    return axios.get('/good/queryGoodList.do?goodId=&goodName=&goodPrice=');
}
function test03() {
    return axios.get('/order/queryOrderList.do');
}
//同时发起,但结果数组是顺序的
axios.all([test01(), test02(), test03()]).then((result) => {
    console.log(result);
});

//同时发起,结果就不是数组而已,但也是只触发1次回调
axios.all([test01(), test02(), test03()]).then(axios.spread(function(res1, res2, res3){
    console.log('所有请求完成')
    console.log('请求1结果', res1)
    console.log('请求2结果', res2)
    console.log('请求3结果', res3)
}));

</script>
</body>
</html>